<template>
    <div class="doc-content">
        <div class="doc-content__body">
            <el-card>
                <h1>TableSelect 表格选择组件</h1>
                <p>TableSelect 组件用于选择表格数据。</p>
                <sc-code lang="html" :code="example1.code" title="基础用法" desc="TableSelect 组件默认使用示例。">
                    <sc-table-select ref="tableSelect" :api-obj="example1.apiObj" />
                </sc-code>

                <h2>属性</h2>
                <el-table :data="fieldTable" style="width: 100%">
                    <el-table-column prop="name" label="属性名" width="120" />
                    <el-table-column prop="desc" label="说明" />
                    <el-table-column prop="type" label="类型" width="80" />
                    <el-table-column prop="val" label="可选值" width="120" />
                    <el-table-column prop="def" label="默认值" width="120" />
                </el-table>
                <h2>事件</h2>
                <el-table :data="eventTable" style="width: 100%">
                    <el-table-column prop="name" label="事件名" width="120" />
                    <el-table-column prop="desc" label="说明" />
                    <el-table-column prop="args" label="回调参数" width="120" />
                </el-table>
            </el-card>
        </div>
    </div>
</template>
<script>
import scCode from '@/components/scCode';
import scTableSelect from '@/components/scTableSelect';

export default {
    name: 'scui_table_select',
    components: {
        scCode,
        scTableSelect,
    },
    data() {
        return {
            example1: {
                apiObj: this.$API.scmurgroup.list,
                code: `<sc-table-select ref="tableSelect" :api-obj="apiObj"/>`,
            },
            fieldTable: [
                { name: 'modelValue', type: 'String', desc: '选择值', val: '', def: '' },
                { name: 'apiObj', type: 'Object', desc: 'API 配置', val: '', def: '{}' },
                { name: 'params', type: 'Array', desc: 'API 参数', val: '', def: '[]' },
                { name: 'placeholder', type: 'String', desc: '占位符', val: '', def: '' },
                { name: 'size', type: 'String', desc: '组件大小', val: 'small, medium, large', def: 'default' },
                { name: 'clearable', type: 'Boolean', desc: '是否可清空', val: '', def: 'false' },
                { name: 'multiple', type: 'Boolean', desc: '是否多选', val: '', def: 'false' },
                { name: 'filterable', type: 'Boolean', desc: '是否可过滤', val: '', def: 'false' },
                { name: 'collapseTags', type: 'Boolean', desc: '是否折叠标签', val: '', def: 'false' },
                { name: 'collapseTagsTooltip', type: 'Boolean', desc: '是否折叠标签时显示 tooltip', val: '', def: 'false' },
                { name: 'disabled', type: 'Boolean', desc: '是否禁用', val: '', def: 'false' },
                { name: 'tableWidth', type: 'Number', desc: '表格宽度', val: '', def: '400' },
                { name: 'mode', type: 'String', desc: '弹出模式', val: 'popover, dropdown', def: 'popover' },
                { name: 'props', type: 'Object', desc: '表格列配置', val: '', def: '{}' },
            ],
            eventTable: [
            ]
        };
    },
    methods: {
    }
}
</script>